# 标题
cmake_minimum_required(VERSION 3.10.0)
project(Shooter VERSION 0.1.0 LANGUAGES C CXX)

# 设置 C++ 标准
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# 预处理
#include_directories("D:/CPP_GameLibrary/SDL2/include")
#link_directories("D:/CPP_GameLibrary/SDL2/lib/x64")

#设置编译输出目录
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR})

# 查找并载入 CMake 预设
find_package(SDL2 REQUIRED)
find_package(SDL2_image REQUIRED)
find_package(SDL2_mixer REQUIRED)
find_package(SDL2_ttf REQUIRED)

# 编译
add_executable(Shooter 
    "source/main.cpp"
    "source/sceneBase.cpp"
    "source/Game.cpp"
    "source/sceneMain.cpp")

# 连接库
target_link_libraries(
    Shooter 
    SDL2::SDL2main 
    SDL2::SDL2 
    SDL2_image::SDL2_image 
    SDL2_mixer::SDL2_mixer 
    SDL2_ttf::SDL2_ttf
    )

# 不要弹出控制台窗口
if(MSVC)
target_link_options(Shooter PRIVATE "/SUBSYSTEM:WINDOWS")
endif()